
//  Copyright:NPU Soccer Base Humanoid group
//  Author:Zhang Duo
//  Date:2019.2.18
//  Entry to the whole program

//
#include <transform.h>
#include <Robot.h>

#define ROBOT_ENABLE true
#define TRANSFORM_ENABLE true

int main(int argc, char const *argv[])
{
    // Transform* trf = new Transform();
    // trf->controller();
    // trf->printOut();
    // std::cout <<"Cost:"<<trf->getCost()<<std::endl;
    // delete trf;
    while(true)
    {
#ifdef ROBOT_ENABLE
        robot *test_robot = new robot();
        unsigned char *message;
        //test->controller();
        char list[200];
// 输入一个用来打乱的操作序列
        cin.getline(list, 200, '\n');
        test_robot->disorder(list);
        test_robot->display();
        test_robot->output();
#endif

#ifdef TRANSFORM_ENABLE
// 这里的构造函数有一个输入，表示用来还原的步骤
        Transform *test = new Transform();
        // test->mainControl(1);
        test->mainControl(1);
        // std::cout << "minCost: " << std::dec <<test->getMinCost() << std::endl;
        test->printCharResult();
        test->printFinalOut();
        // test->printOut();
        message = test-> getMessage();
        std::cout<<message << std::endl;
#endif
#ifdef TRANSFORM_ENABLE && ROBOT_ENABLE
        test_robot->translate(message);
        test_robot->display();
#endif
        
    }
    return 0;
    
}
